package com.shire.shire_interface.conf;

import com.shire.shire_interface.service.account.impl.DeviceCodeService;
import com.shire.shire_interface.service.account.impl.DeviceInfoService;
import com.shire.shire_interface.service.account.impl.DeviceKeyService;
import com.shire.shire_interface.service.account.impl.WxStationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;

@Service
public class InstanceManager {
    @Autowired
    private WxStationService stationService;
    @Autowired
    private DeviceInfoService deviceInfoService;
    @Autowired
    private DeviceCodeService deviceCodeService;
    @Autowired
    private DeviceKeyService deviceKeyService;

    private static InstanceManager instance;

    @PostConstruct
    public void init(){
        instance = this;
    }

    public static InstanceManager getInstance() {
        return instance;
    }

    public WxStationService getStationService() {
        return stationService;
    }

    public void setStationService(WxStationService stationService) {
        this.stationService = stationService;
    }

    public DeviceInfoService getDeviceInfoService() {
        return deviceInfoService;
    }

    public void setDeviceInfoService(DeviceInfoService deviceInfoService) {
        this.deviceInfoService = deviceInfoService;
    }

    public DeviceCodeService getDeviceCodeService() {
        return deviceCodeService;
    }

    public void setDeviceCodeService(DeviceCodeService deviceCodeService) {
        this.deviceCodeService = deviceCodeService;
    }

    public DeviceKeyService getDeviceKeyService() {
        return deviceKeyService;
    }

    public void setDeviceKeyService(DeviceKeyService deviceKeyService) {
        this.deviceKeyService = deviceKeyService;
    }

    public static void setInstance(InstanceManager instance) {
        InstanceManager.instance = instance;
    }
}
